package cn.itcast.bos.web.interceptor;

import cn.itcast.bos.domain.User;
import cn.itcast.bos.utils.BOSContext;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor;

public class BOSLoginInterceptor extends MethodFilterInterceptor{

	@Override
	protected String doIntercept(ActionInvocation invocation) throws Exception {
		User user = BOSContext.getLoginUser();
		if(user == null){
			return "login";
		}else{
			return invocation.invoke();
		}
	}

}
